#define MAIN
#include <stdio.h>
#include <stddef.h>
#include "rt.h"

INT nprocs = 1;
int ParmacsThreadNum = 0;
pthread_t ParmacsThreads[128];  // 或 PARMACS_MAX_THREADS

INT DataType = 0;
INT TraversalType = 0;

INT bundlex = 0, bundley = 0;
INT blockx = 0, blocky = 0;
INT NumSubRays = 1;

BOOL GeoFile = FALSE;
BOOL PicFile = FALSE;
BOOL ModelNorm = FALSE;
BOOL ModelTransform = FALSE;
BOOL AntiAlias = FALSE;

CHAR *ProgName = NULL;
CHAR GeoFileName[80] = {0};
CHAR PicFileName[80] = {0};

VIEW View;
DISPLAY Display;
LIGHT *lights = NULL;
INT nlights = 0;

GMEM *gm = NULL;

GRID *world_level_grid = NULL;
GRID *gridlist = NULL;

INT hu_max_prims_cell = 0;
INT hu_gridsize = 0;
INT hu_numbuckets = 0;
INT hu_max_subdiv_level = 0;
INT hu_lazy = 0;

INT prim_obj_cnt = 0;
INT prim_elem_cnt = 0;
INT subdiv_cnt = 0;
INT bintree_cnt = 0;

INT grids = 0;
INT total_cells = 0;
INT empty_voxels = 0;
INT nonempty_voxels = 0;
INT nonempty_leafs = 0;
INT prims_in_leafs = 0;

UINT empty_masks[sizeof(UINT) * 8] = {0};
UINT nonempty_masks[sizeof(UINT) * 8] = {0};




